Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scripts: use default babel if none is found in project #14168

Merged
merged 19 commits into from
Mar 14, 2019

Conversation

oandregal
Copy link
Member

@oandregal oandregal commented Feb 28, 2019

Changes to make Webpack use the @wordpress/babel-preset-default babel config if none is found when running wp-scripts build/start.

Test

  • make sure you can build Gutenberg for development: npm run dev and that it works as expected.
  • make sure you can build Gutenberg for production: npm run build and that it works as expected.
  • external testbed using the default babel config Add/wp scripts babel oandregal/understanding-gutenberg#7

@oandregal oandregal changed the title Add/babel to scripts Scripts: use default babel if none is found in project Feb 28, 2019
@oandregal oandregal self-assigned this Feb 28, 2019
@oandregal oandregal added [Type] Build Tooling Issues or PRs related to build tooling [Package] Scripts /packages/scripts labels Feb 28, 2019
packages/scripts/config/webpack.config.js Outdated Show resolved Hide resolved
packages/babel-preset-default/index.js Outdated Show resolved Hide resolved
@oandregal oandregal force-pushed the add/defaults-to-scripts-build branch from b9f6973 to 6da9e92 Compare March 11, 2019 12:15
@oandregal oandregal changed the base branch from add/defaults-to-scripts-build to master March 12, 2019 12:18
@oandregal oandregal marked this pull request as ready for review March 12, 2019 12:19
@oandregal oandregal requested a review from gziolo March 12, 2019 12:19
bin/packages/build.js Show resolved Hide resolved
packages/babel-preset-default/index.js Show resolved Hide resolved
packages/babel-preset-default/index.js Show resolved Hide resolved
packages/babel-preset-default/index.js Show resolved Hide resolved
@oandregal oandregal force-pushed the add/babel-to-scripts branch 3 times, most recently from 2dcc4e0 to eb88287 Compare March 14, 2019 09:38
@oandregal oandregal requested a review from gziolo March 14, 2019 12:28
test/unit/jest.config.json Outdated Show resolved Hide resolved
@@ -7,6 +7,7 @@ const { hasPackageProp } = require( './package' );

const hasBabelConfig = () =>
hasProjectFile( '.babelrc' ) ||
hasProjectFile( '.babelrc.js' ) ||
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch :)

Individual packages shouldn't have node_modules installed in
their local paths in a normal Gutenberg operation. Yet,
if you `cd packages/<packagename> && npm install` things start
going south - like tests not passing.
Copy link
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested it very extensively and it all works perfectly fine. Thi is AMAZING. Outstanding work on making it all work!!!

🥇 💯 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Scripts /packages/scripts [Type] Build Tooling Issues or PRs related to build tooling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants